package com.cloud.service.sys.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.cloud.domain.sys.FolderConfig;
import com.cloud.mapper.sys.FolderConfigMapper;
import com.cloud.service.sys.FolderConfigService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.cloud.type.sys.FolderConfigStatus;
import com.cloud.type.sys.StorageType;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author liuyuan
 * @since 2019-10-25
 */
@Service
public class FolderConfigServiceImpl extends ServiceImpl<FolderConfigMapper, FolderConfig> implements FolderConfigService {

    @Override
    public FolderConfig getPathConfig(StorageType storageType) {
        FolderConfig folderConfig = new FolderConfig();
        folderConfig.setStatus(FolderConfigStatus.ACTIVE);
        folderConfig.setStorageType(storageType);
        QueryWrapper<FolderConfig> queryWrapper = new QueryWrapper<>(folderConfig);
        return this.getOne(queryWrapper);
    }
}
